<%@ taglib prefix="c"   uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@page import = "com.db4o.servlet.Db4oServlet" %>
<%@page import = "facades.*" %>
<%@page import = "auser.*" %>
<%@page import = "com.db4o.query.*" %>
<% SessionFacade sfacade = new SessionFacade(session); %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link rel="stylesheet"  href="<%=request.getContextPath()%>/css/display.css" type="text/css" media="screen" />
<script src="<%=request.getContextPath()%>/js/jquery.js"></script>
<script src="<%=request.getContextPath()%>/js/form.js"></script>
<script type="text/javascript" src='<%=request.getContextPath()%>/js/input01.js'></script>
<title>Gestione Auser - Motivi di accompagnato</title>
<style>
	form{margin:2px 6px 2px 6px;padding: 4px 2px 1px 2px}
</style>
</head>
<body>
		 	 		 
	 
	<% Query qu = sfacade.newQuery(MotiviAccompagnamento.class); %>  
 	<% qu.descend("descrizione").orderAscending() ;  %>
	<h1>Motivi di accompagnato</h1> 
	
 	<fieldset class='searchResult'>
		<legend>Elenco</legend> 
		  	<%  int co=1;  %>
	 		<c:forEach items="<%=qu.execute()%>" var="obj" varStatus="status">
				<form action="save.jsp" method="post">
					<input type="hidden" value="<%=sfacade.getID("obj",pageContext) %>" name="id"  />
					<label style="text-align:right"><%= co++ %>)</label><input class="submitter" type="text"  name="descrizione" value="${obj.descrizione}" size="50"/>
					<input name="save" type="submit" value="Salva" style="margin-left:1px; "/>
				</form>
				 
			</c:forEach>
			 
			<form action="save.jsp" method="post">
				<input type="hidden" value="" name="id" />
				<label style="text-align:right"><%= co %>)</label><input class="submitter" type="text"  name="descrizione" value="" size="50" />
				<input name="save" type="submit" value="Salva" style="margin-left:1px; " />
			</form>
			
		 	<br>
		 	<input style="margin-left:660px" class='button' type='button' value='Chiudi' id='btnClose' onclick='document.location="<%=request.getContextPath()%>/app/start/index.jsp"'>
		 	
		<br>
 	</fieldset>
 	<script>
 		$(".submitter").change( this.form.submit()).blur( this.form.submit() );
 	</script>
	
</body>
</html>